{% extends "admin/base_site.html" %}
{% load i18n admin_static %}

{% block extrastyle %}
{{ block.super }}
<!-- <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" /> -->
{% endblock %}

{% block coltype %}colMS{% endblock %}

{% block bodyclass %}dashboard{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block content %}
<div class="row">
	<!-- app list -->
	<div class="col-sm-8 col-xs-12">
	{% if app_list %}
		{% for app in app_list %}
			<div class="panel panel-default">
				<!-- Default panel contents -->
				<div class="panel-heading">{{app.name}}</div>
				<!-- List group, for lager devices -->
				<ul class="list-group hidden-xs">
					{% for model in app.models %}
						<li class="list-group-item">
							<div class="name">
							{% if model.admin_url %}
								<a href="{{ model.admin_url }}"><i class="fa fa-pencil fa-lg"></i> {{ model.name }} </a>
							{% else %}
								{{ model.name }}
							{% endif %}
								
							{% if model.add_url %}
								<a class="pull-right" href="{{ model.add_url }}"><i class="fa fa-plus fa-lg"></i> {% trans 'Add' %}</a>
							{% endif %}
							
							</div>
						</li>
					{% endfor %}
				</ul>
				<!-- button lists, for phone devices -->
				<div class="visible-xs">
					{% for model in app.models %}
						{% if model.admin_url %}
						<div class="name">
							<a class="btn btn-default btn-block" href="{{ model.admin_url }}"><i class="fa fa-pencil fa-lg"></i> {{ model.name }}</a>
						</div>
						{% endif %}
					{% endfor %}
				</div>
			</div>
		{% endfor %}
	{% else %}
		<h3 class="text-danger">{% trans "You don't have permission to edit anything." %}</h3>
	{% endif %}
	</div>
	<!-- relative actions -->
	<div class="col-sm-4 hidden-xs">
		<div class="panel panel-default">
			<div class="panel-heading">{% trans 'Recent Actions' %}</div>
			<div class="panel-body">{% trans 'My Actions' %}</div>
			{% load log %}
			{% get_admin_log 10 as admin_log for_user user %}
			{% if not admin_log %}
			<p>{% trans 'None available' %}</p>
			{% else %}
			<ul class="actionlist">
			{% for entry in admin_log %}
			<li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
				{% if entry.is_deletion or not entry.get_admin_url %}
					{{ entry.object_repr }}
				{% else %}
					<a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
				{% endif %}
				<br/>
				{% if entry.content_type %}
					<span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span>
				{% else %}
					<span class="mini quiet">{% trans 'Unknown content' %}</span>
				{% endif %}
			</li>
			{% endfor %}
			</ul>
			{% endif %}
		</div>
	</div>
</div>
{% endblock %}

{% block sidebar %}{% endblock %}
